home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / System Extras Headers / GX Headers / Collections.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  10.5 KB  |  268 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        Collections.h
  3.  
  4.     Copyright:    © 1984-1994 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __COLLECTIONMANAGER__
  13. #define __COLLECTIONMANAGER__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. enum  {
  23.     gestaltCollectionMgrVersion    = 'cltn'
  24. };
  25.  
  26. enum  {
  27.     collectionItemLockedErr        = -5750,
  28.     collectionItemNotFoundErr    = -5751,
  29.     collectionIndexRangeErr        = -5752,
  30.     collectionVersionErr        = -5753
  31. };
  32.  
  33. enum  {
  34.     dontWantTag                    = 0L,
  35.     dontWantId                    = 0L,
  36.     dontWantSize                = 0L,
  37.     dontWantAttributes            = 0L,
  38.     dontWantIndex                = 0L,
  39.     dontWantData                = 0L
  40. };
  41.  
  42. enum  {
  43.     noCollectionAttributes        = 0x00000000,
  44.     allCollectionAttributes        = 0xFFFFFFFF,
  45.     userCollectionAttributes    = 0x0000FFFF,
  46.     defaultCollectionAttributes    = 0x40000000
  47. };
  48.  
  49. enum  {
  50.     collectionUser0Bit            = 0,
  51.     collectionUser1Bit            = 1,
  52.     collectionUser2Bit            = 2,
  53.     collectionUser3Bit            = 3,
  54.     collectionUser4Bit            = 4,
  55.     collectionUser5Bit            = 5,
  56.     collectionUser6Bit            = 6,
  57.     collectionUser7Bit            = 7,
  58.     collectionUser8Bit            = 8,
  59.     collectionUser9Bit            = 9,
  60.     collectionUser10Bit            = 10,
  61.     collectionUser11Bit            = 11,
  62.     collectionUser12Bit            = 12,
  63.     collectionUser13Bit            = 13,
  64.     collectionUser14Bit            = 14,
  65.     collectionUser15Bit            = 15,
  66.     collectionReserved0Bit        = 16,
  67.     collectionReserved1Bit        = 17,
  68.     collectionReserved2Bit        = 18,
  69.     collectionReserved3Bit        = 19,
  70.     collectionReserved4Bit        = 20,
  71.     collectionReserved5Bit        = 21,
  72.     collectionReserved6Bit        = 22,
  73.     collectionReserved7Bit        = 23,
  74.     collectionReserved8Bit        = 24,
  75.     collectionReserved9Bit        = 25,
  76.     collectionReserved10Bit        = 26,
  77.     collectionReserved11Bit        = 27,
  78.     collectionReserved12Bit        = 28,
  79.     collectionReserved13Bit        = 29,
  80.     collectionPersistenceBit    = 30,
  81.     collectionLockBit            = 31
  82. };
  83.  
  84. enum  {
  85.     collectionUser0Mask            = 1L << collectionUser0Bit,
  86.     collectionUser1Mask            = 1L << collectionUser1Bit,
  87.     collectionUser2Mask            = 1L << collectionUser2Bit,
  88.     collectionUser3Mask            = 1L << collectionUser3Bit,
  89.     collectionUser4Mask            = 1L << collectionUser4Bit,
  90.     collectionUser5Mask            = 1L << collectionUser5Bit,
  91.     collectionUser6Mask            = 1L << collectionUser6Bit,
  92.     collectionUser7Mask            = 1L << collectionUser7Bit,
  93.     collectionUser8Mask            = 1L << collectionUser8Bit,
  94.     collectionUser9Mask            = 1L << collectionUser9Bit,
  95.     collectionUser10Mask        = 1L << collectionUser10Bit,
  96.     collectionUser11Mask        = 1L << collectionUser11Bit,
  97.     collectionUser12Mask        = 1L << collectionUser12Bit,
  98.     collectionUser13Mask        = 1L << collectionUser13Bit,
  99.     collectionUser14Mask        = 1L << collectionUser14Bit,
  100.     collectionUser15Mask        = 1L << collectionUser15Bit,
  101.     collectionReserved0Mask        = 1L << collectionReserved0Bit,
  102.     collectionReserved1Mask        = 1L << collectionReserved1Bit,
  103.     collectionReserved2Mask        = 1L << collectionReserved2Bit,
  104.     collectionReserved3Mask        = 1L << collectionReserved3Bit,
  105.     collectionReserved4Mask        = 1L << collectionReserved4Bit,
  106.     collectionReserved5Mask        = 1L << collectionReserved5Bit,
  107.     collectionReserved6Mask        = 1L << collectionReserved6Bit,
  108.     collectionReserved7Mask        = 1L << collectionReserved7Bit,
  109.     collectionReserved8Mask        = 1L << collectionReserved8Bit,
  110.     collectionReserved9Mask        = 1L << collectionReserved9Bit,
  111.     collectionReserved10Mask    = 1L << collectionReserved10Bit,
  112.     collectionReserved11Mask    = 1L << collectionReserved11Bit,
  113.     collectionReserved12Mask    = 1L << collectionReserved12Bit,
  114.     collectionReserved13Mask    = 1L << collectionReserved13Bit,
  115.     collectionPersistenceMask    = 1L << collectionPersistenceBit,
  116.     collectionLockMask            = 1L << collectionLockBit
  117. };
  118.  
  119. #define collectionManagerTrap 0xABF6
  120.  
  121. typedef struct PrivateCollectionRecord *Collection;
  122.  
  123. typedef long CollectionTag;
  124.  
  125. typedef pascal OSErr (*CollectionFlattenProcPtr)(long size, void *data, void *refCon);
  126.  
  127. enum {
  128.     uppCollectionFlattenProcInfo = kPascalStackBased
  129.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  130.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  131.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
  132.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
  133. };
  134.  
  135. #if USESROUTINEDESCRIPTORS
  136. typedef UniversalProcPtr CollectionFlattenUPP;
  137.  
  138. #define CallCollectionFlattenProc(userRoutine, size, data, refCon)        \
  139.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCollectionFlattenProcInfo, (size), (data), (refCon))
  140. #define NewCollectionFlattenProc(userRoutine)        \
  141.         (CollectionFlattenUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionFlattenProcInfo, GetCurrentISA())
  142. #else
  143. typedef CollectionFlattenProcPtr CollectionFlattenUPP;
  144.  
  145. #define CallCollectionFlattenProc(userRoutine, size, data, refCon)        \
  146.         (*(userRoutine))((size), (data), (refCon))
  147. #define NewCollectionFlattenProc(userRoutine)        \
  148.         (CollectionFlattenUPP)(userRoutine)
  149. #endif
  150.  
  151. typedef CollectionFlattenProcPtr CollectionFlattenProc;
  152.  
  153. typedef pascal OSErr (*CollectionExceptionProcPtr)(Collection c, OSErr status);
  154.  
  155. enum {
  156.     uppCollectionExceptionProcInfo = kPascalStackBased
  157.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  158.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Collection)))
  159.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(OSErr)))
  160. };
  161.  
  162. #if USESROUTINEDESCRIPTORS
  163. typedef UniversalProcPtr CollectionExceptionUPP;
  164.  
  165. #define CallCollectionExceptionProc(userRoutine, c, status)        \
  166.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppCollectionExceptionProcInfo, (c), (status))
  167. #define NewCollectionExceptionProc(userRoutine)        \
  168.         (CollectionExceptionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppCollectionExceptionProcInfo, GetCurrentISA())
  169. #else
  170. typedef CollectionExceptionProcPtr CollectionExceptionUPP;
  171.  
  172. #define CallCollectionExceptionProc(userRoutine, c, status)        \
  173.         (*(userRoutine))((c), (status))
  174. #define NewCollectionExceptionProc(userRoutine)        \
  175.         (CollectionExceptionUPP)(userRoutine)
  176. #endif
  177.  
  178. typedef CollectionExceptionProcPtr CollectionExceptionProc;
  179.  
  180. #ifdef __cplusplus
  181. extern "C" {
  182. #endif
  183.  
  184. extern pascal Collection NewCollection(void)
  185.  TWOWORDINLINE(0x7000, 0xABF6);
  186. extern pascal void DisposeCollection(Collection)
  187.  TWOWORDINLINE(0x7001, 0xABF6);
  188. extern pascal Collection CloneCollection(Collection)
  189.  TWOWORDINLINE(0x7002, 0xABF6);
  190. extern pascal long CountCollectionOwners(Collection)
  191.  TWOWORDINLINE(0x7003, 0xABF6);
  192. extern pascal Collection CopyCollection(Collection srcCollection, Collection dstCollection)
  193.  TWOWORDINLINE(0x7004, 0xABF6);
  194. extern pascal long GetCollectionDefaultAttributes(Collection)
  195.  TWOWORDINLINE(0x7005, 0xABF6);
  196. extern pascal void SetCollectionDefaultAttributes(Collection, long whichAttributes, long newAttributes)
  197.  TWOWORDINLINE(0x7006, 0xABF6);
  198. extern pascal long CountCollectionItems(Collection)
  199.  TWOWORDINLINE(0x7007, 0xABF6);
  200. extern pascal OSErr AddCollectionItem(Collection, CollectionTag, long id, long itemSize, void *itemData)
  201.  TWOWORDINLINE(0x7008, 0xABF6);
  202. extern pascal OSErr GetCollectionItem(Collection, CollectionTag, long id, long *itemSize, void *itemData)
  203.  TWOWORDINLINE(0x7009, 0xABF6);
  204. extern pascal OSErr RemoveCollectionItem(Collection, CollectionTag, long id)
  205.  TWOWORDINLINE(0x700A, 0xABF6);
  206. extern pascal OSErr SetCollectionItemInfo(Collection, CollectionTag, long id, long whichAttributes, long newAttributes)
  207.  TWOWORDINLINE(0x700B, 0xABF6);
  208. extern pascal OSErr GetCollectionItemInfo(Collection, CollectionTag, long id, long *index, long *itemSize, long *attributes)
  209.  TWOWORDINLINE(0x700C, 0xABF6);
  210. extern pascal OSErr ReplaceIndexedCollectionItem(Collection, long index, long itemSize, void *itemData)
  211.  TWOWORDINLINE(0x700D, 0xABF6);
  212. extern pascal OSErr GetIndexedCollectionItem(Collection, long index, long *itemSize, void *itemData)
  213.  TWOWORDINLINE(0x700E, 0xABF6);
  214. extern pascal OSErr RemoveIndexedCollectionItem(Collection, long index)
  215.  TWOWORDINLINE(0x700F, 0xABF6);
  216. extern pascal OSErr SetIndexedCollectionItemInfo(Collection, long index, long whichAttributes, long newAttributes)
  217.  TWOWORDINLINE(0x7010, 0xABF6);
  218. extern pascal OSErr GetIndexedCollectionItemInfo(Collection, long index, CollectionTag *, long *id, long *itemSize, long *attributes)
  219.  TWOWORDINLINE(0x7011, 0xABF6);
  220. extern pascal Boolean CollectionTagExists(Collection, CollectionTag)
  221.  TWOWORDINLINE(0x7012, 0xABF6);
  222. extern pascal long CountCollectionTags(Collection)
  223.  TWOWORDINLINE(0x7013, 0xABF6);
  224. extern pascal OSErr GetIndexedCollectionTag(Collection, long whichTag, CollectionTag *)
  225.  TWOWORDINLINE(0x7014, 0xABF6);
  226. extern pascal long CountTaggedCollectionItems(Collection, CollectionTag)
  227.  TWOWORDINLINE(0x7015, 0xABF6);
  228. extern pascal OSErr GetTaggedCollectionItem(Collection, CollectionTag, long whichItem, long *itemSize, void *itemData)
  229.  TWOWORDINLINE(0x7016, 0xABF6);
  230. extern pascal OSErr GetTaggedCollectionItemInfo(Collection, CollectionTag, long whichItem, long *id, long *index, long *itemSize, long *attributes)
  231.  TWOWORDINLINE(0x7017, 0xABF6);
  232. extern pascal void PurgeCollection(Collection, long whichAttributes, long matchingAttributes)
  233.  TWOWORDINLINE(0x7018, 0xABF6);
  234. extern pascal void PurgeCollectionTag(Collection, CollectionTag)
  235.  TWOWORDINLINE(0x7019, 0xABF6);
  236. extern pascal void EmptyCollection(Collection)
  237.  TWOWORDINLINE(0x701A, 0xABF6);
  238. extern pascal OSErr FlattenCollection(Collection, CollectionFlattenProc, void *refCon)
  239.  TWOWORDINLINE(0x701B, 0xABF6);
  240. extern pascal OSErr FlattenPartialCollection(Collection, CollectionFlattenProc, void *refCon, long whichAttributes, long matchingAttributes)
  241.  TWOWORDINLINE(0x701C, 0xABF6);
  242. extern pascal OSErr UnflattenCollection(Collection, CollectionFlattenProc, void *refCon)
  243.  TWOWORDINLINE(0x701D, 0xABF6);
  244. extern pascal CollectionExceptionProc GetCollectionExceptionProc(Collection)
  245.  TWOWORDINLINE(0x701E, 0xABF6);
  246. extern pascal void SetCollectionExceptionProc(Collection, CollectionExceptionProc)
  247.  TWOWORDINLINE(0x701F, 0xABF6);
  248. extern pascal Collection GetNewCollection(short collectionID)
  249.  TWOWORDINLINE(0x7020, 0xABF6);
  250. extern pascal OSErr AddCollectionItemHdl(Collection aCollection, CollectionTag tag, long id, Handle itemData)
  251.  TWOWORDINLINE(0x7021, 0xABF6);
  252. extern pascal OSErr GetCollectionItemHdl(Collection aCollection, CollectionTag tag, long id, Handle itemData)
  253.  TWOWORDINLINE(0x7022, 0xABF6);
  254. extern pascal OSErr ReplaceIndexedCollectionItemHdl(Collection aCollection, long index, Handle itemData)
  255.  TWOWORDINLINE(0x7023, 0xABF6);
  256. extern pascal OSErr GetIndexedCollectionItemHdl(Collection aCollection, long index, Handle itemData)
  257.  TWOWORDINLINE(0x7024, 0xABF6);
  258. extern pascal OSErr FlattenCollectionToHdl(Collection aCollection, Handle flattened)
  259.  TWOWORDINLINE(0x7025, 0xABF6);
  260. extern pascal OSErr UnflattenCollectionFromHdl(Collection aCollection, Handle flattened)
  261.  TWOWORDINLINE(0x7026, 0xABF6);
  262. #ifdef __cplusplus
  263. }
  264. #endif
  265.  
  266. #endif
  267.  
  268.